<template>
  <div id="app">
    <router-view name="header"></router-view>
    <div class="container">
        <nav>
            <router-link to="/posts">帖子列表</router-link>
            <router-link to="/profile">个人资料</router-link>
        </nav>
        <main>
            <transition name="fade" mode="out-in">
                <router-view></router-view>
            </transition>
        </main>
    </div>
    <router-view name="footer"></router-view>
  </div>
</template>



<script>
import Header from './components/Header.vue'
import Footer from './components/Footer.vue'

export default {
  name: 'App',
  components: {
     Header,
     Footer
  }
}
</script>



<style>
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* text-align: center; */
  color: #2c3e50;
}
header {
    background-color: #3498db;
    color: white;
    padding: 10px;
    text-align: center;
}
.container {
    display: flex;
    flex: 1;
}
nav {
    width: 200px;
    background-color: #f4f4f4;
    padding: 10px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}
nav a {
    display: block;
    padding: 10px;
    color: #333;
    text-decoration: none;
    margin-bottom: 5px;
    border-radius: 4px;
}
nav a:hover {
    background-color: #ddd;
}
nav .router-link-active {
    background-color: #3498db;
    color: white;
}
main {
    flex: 1;
    padding: 20px;
}
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 10px;
}
</style>
